#include <iostream>

using namespace std;

int main()
{
	int a[10]={-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
	
	int begin=0, end=9;
	int sum=0,tempSum=0;
	int tb, te;

	int i=0;
	while(i++<10)
	{
		if(a[i] >0)
		{
			te=i;
			if(tempSum==0)
				tb=i;
		}
		tempSum += a[i];
		if(tempSum < 0)
			tempSum = 0;
		if(tempSum > sum)
		{
			sum = tempSum;
			begin = tb;
			end = te;
		}
	}
	
	cout<<sum<<endl;
	cout<<"start: "<<begin<<" end: "<<end<<endl;
	return 0;
}
